<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>整车预定</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/rentproduct/list">整车预定</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="tRentproduct" action="${ctx}/rentproduct/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div>
			<label>发车日期：</label>
			<input name="fromdateStr" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
				value="${tRentproduct.fromdateStr }"
				onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'<fmt:formatDate value="${date}" pattern="yyyy-MM-dd"/>',isShowClear:false});"/>
			<label>发车时间：</label>
			<input name="time" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate" value="${time }"
				onclick="WdatePicker({dateFmt:'HH:mm',isShowClear:false});"/>
			<label>包车天数：</label>
			<select name="days" class="input-mini">
				<c:forEach items="1,2,3,4,5,6,7,8,9,10" var="day">
					<option value="${day }" <c:if test="${days == day }">selected</c:if>>${day }天</option>
				</c:forEach>
			</select>
			<label>服务开始城市：</label>
			<sys:treeselect id="departcity" name="departcity.code" value="${tRentproduct.departcity.code}"
					labelName="departcity.name" labelValue="${tRentproduct.departcity.name}" title="服务开始城市"
					url="/sys/area/treeData" notAllowSelectParent="true" valueAttr="code"
					cssClass="input-mini" allowClear="false" hideBtn="true"/>
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>发车日期</th>
				<th>产品名称</th>
				<th>车型名称</th>
				<th>座位数</th>			
				<th>套餐价</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tRentproduct">
			<tr>
				<td>
					<fmt:formatDate value="${tRentproduct.fromdate}" pattern="yyyy-MM-dd"/>&nbsp;${time }
				</td>
				<td><a href="javascript:;">
					${tRentproduct.productname}
				</a></td>
				<td>
					${tRentproduct.cargotype.typename}
				</td>
				<td>
					${tRentproduct.cargotype.seats}
				</td>
				<td>
					￥${tRentproduct.suitrtnprice}
				</td>
				<td>
					<a href="${ctx}/rentproduct/details?time=${time }&days=${days }&rentid=${tRentproduct.rentid}">预定</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>